//class Mouse implements IUSB{
//
//    public void deviceOpen(){
//        System.out.println("连接鼠标");
//    }
//}

import java.util.Arrays;

interface A{
    void funcA();
}

interface B{
    void funcB();
}

interface CC extends A,B{
    void func();
}

class C implements CC{
    @Override
    public void funcA() {

    }

    @Override
    public void funcB() {

    }

    @Override
    public void func() {

    }
}

class Student implements Comparable<Student>{
    public String name;
    public int age;
    public int score;

    public Student(String name, int age, int score) {
        this.name = name;
        this.age = age;
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", score=" + score +
                '}';
    }

    @Override
    public int compareTo(Student o) {
        if(this.age > o.age) {
            return 1;
        }else if(this.age < o.age) {
            return -1;
        }else {
            return 0;
        }
    }
}
public class Text {
    public static void main(String[] args) {
        Student[] stu = new Student[3];
        stu[0] = new Student("六六大顺",18,88);
        stu[1] = new Student("七星高照",22,98);
        stu[2] = new Student("三羊开泰",19,100);

        Arrays.sort(stu);
        System.out.println(Arrays.toString(stu));
    }
    public static void func(IShape shape){
        shape.drawshape();
        shape.shake();
    }

    public static void walk(IRunning r){
        r.run();
    }

    public static void main3(String[] args) {
        walk(new Dog("小汪"));
        walk(new Duck("唐老鸭"));
        walk(new Robot("瓦力"));
    }

    public static void main2(String[] args) {
        Computer computer = new Computer();
        IUSB usbM = new Mouse();
        computer.open();
        computer.useDevice(usbM);
        System.out.println("==========================");
        IUSB usbK = new KeyBorad();
        computer.useDevice(usbK);
        computer.close();
    }

    public static void main1(String[] args) {
        IShape shape = new Love(); //向上转型
        IShape shape1 = new Star();
        func(shape);
        func(shape1);

    }
}
